﻿⍝ ⎕PROFILE
)load newleaf
AutoMeasure
View PG
⎕AI[2 3]
t←⎕AI[2 3]
AutoMeasure
⎕AI[2 3]-t
]cputime "AutoMeasure"
]cputime "AutoMeasure -repeat=10"
)copy dfns cmpx
data←0.1×?1000 1000⍴1000
cmpx '+/+/data' '+/,data'
⍝ Ah yes... ⎕PROFILE!
⍝ Help|Documentation Centre|Tuning Applications using the ]PROFILE User Command
]open http://docs.dyalog.com
⎕CMD 'taskmgr' '' ⍝ Now set priority
⎕pw←1000
⎕profile 'start'
AutoMeasure
⎕profile 'stop'
⎕profile 'clear' ⋄ ⎕profile 'start' ⋄ AutoMeasure ⋄ ⎕profile 'stop'
⍴data←⎕profile 'data'
'Function' 'Line' 'Calls' 'Exclusive' 'Inclusive' 'Excl #Clock' 'Incl #Clock'⍪15↑data
⍴tree←⎕profile 'tree'
10↑tree
'CI9' ⎕fmt ⎕size 'tree'
]profile summary
]profile summary -lines -first=10
]?profile
]??profile
]profile summary -lines -exclusive -avg -code
⎕SE.UCMD 'profile tree -expr="AutoMeasure" -outfile="c:\temp\automeasure_profile.xml"'
⎕USING←'System.IO'
(⎕NEW DirectoryInfo (⊂'c:\temp')).(GetFiles⊂'automeasure_profile.xml').Length
)cmd notepad "c:\temp\automeasure_profile.xml"
)clear
⍴⎕profile 'data'
]profile summary -first=5 -infile="c:\temp\automeasure_profile.xml"
)load newleaf
⎕pw←1000
]profile -expr="AutoMeasure"
)load dfns
]profile -expr="⍴queens 9"
)LOAD "c:\devt\mtbcup\mtbcup11.DWS"
]open C:\devt\mtbcup\2011\afd5.htm
]open C:\devt\aplweb\Sites\CKK\vc2011main.htm
]profile -expr="MTB"
tds←{⍺←⍬ ⋄ 0=⍴⍵:⍺ ⋄ h t←'td'GetTag ⍵ ⋄ (⍺,⊂h)∇ t}       
100↑bigdata←(10×⍴data)⍴data←'<td align="right">BAA</td><td align="left">London</td>'
4↑tds bigdata
tds2←'(<td.*>)(.*)(</td>)' ⎕S '\2' ⍠ 'Greedy' 0
cmpx 'tds bigdata' 'tds2 bigdata'
]profile SUMMARY -expr="MTB" -first=4
tds←'(<td.*>)(.*)(</td>)' ⎕S '\2' ⍠ 'Greedy' 0
]profile SUMMARY -expr="MTB" -first=4
